package function;

import java.io.File;

public class DropView {
    //delete table 表名
    public static void deleteView(String dbName, String tbName) {
        //判断数据库是否为空
        if (IsLegal.isDatabaseEmpty()) {
            return;
        }

        //表存在则返回一个对象
        File file = IsLegal.isView(dbName, tbName);
        File direction = new File("./mydatabase/" + dbName + "/" + tbName + "");

//        System.out.println(file);

        //删除整个视图
        file.delete();
        direction.delete();
        System.out.println(tbName+ "视图删除成功");

    }
}
